package com.jy.rhin.facade.ws.registration.terminology;

import cn.org.chiss.rhin._2015.registration.terminology.ConceptMapQueryRequest;
import cn.org.chiss.rhin._2015.registration.terminology.ConceptMapQueryResponse;
import cn.org.chiss.rhin._2015.registration.terminology.RetrieveConceptMapRequest;
import cn.org.chiss.rhin._2015.registration.terminology.RetrieveConceptMapResponse;
import com.jy.api.misc.MiscAPI;
import com.jy.rhin.application.assembler.ConceptMapAssembler;
import com.jy.rhin.application.registration.ConceptMapService;
import com.jy.rhin.config.NamespaceConstants;
import com.jy.rhin.support.aspect.AuditLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.jws.WebService;

@WebService(
        serviceName = "ConceptMapProvider",
        portName = "ConceptMapProviderPort",
        targetNamespace = NamespaceConstants.NS_RHIN,
        endpointInterface = "com.jy.rhin.facade.ws.registration.terminology.ConceptMapProvider")
@Component
public class ConceptMapProviderPortImpl implements ConceptMapProvider {

    @Autowired
    private ConceptMapService conceptMapService;

    @AuditLog
    @Override
    public RetrieveConceptMapResponse retrieveConceptMap(RetrieveConceptMapRequest message) {
        RetrieveConceptMapResponse response = conceptMapService.jiZhiYSHQ(message.getId().getValue());
        return response;
    }

    @AuditLog
    @Override
    public ConceptMapQueryResponse conceptMapQuery(ConceptMapQueryRequest message) {
        ConceptMapQueryResponse response = conceptMapService.jiZhiYSCX(message);
        return response;
    }
}
